//
//  CLDesignPatternViewController.m
//  Charles
//
//  Created by Charles on 2019/5/30.
//  Copyright © 2019 charles. All rights reserved.
//

#import "CLDesignPatternViewController.h"
#import "AdapterTest.h"
#import "PrototypeTest.h"
#import "BridgeTest.h"
#import "ChainTest.h"
#import "TestComposite.h"
#import "DecoratorTest.h"
#import "VisitorTest.h"

@interface CLDesignPatternViewController ()

@end

@implementation CLDesignPatternViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 适配器模式测试
    // [self adapterTest];
    // 原型模式测试
    // [self protoTypeTest];
    // 桥接模式
    // [self bridgeTest];
    // 责任链模式
    // [self chainOfResponsibility];
    // 组合模式
    // [TestComposite testComposite];
    // 装饰者模式
    // [DecoratorTest testDelegate];
    // 访问器模式
    [VisitorTest visitorTest];
}

// 桥接模式
- (void)bridgeTest {
    [BridgeTest bridgeTest];
}

// 适配器模式
- (void)adapterTest {
    [AdapterTest classAdapterTest];
    [AdapterTest objectAdapterTest];
}

// 原型模式
- (void)protoTypeTest {
    [PrototypeTest testProtoType];
}

- (void)chainOfResponsibility {
    [ChainTest testChainOfResponsibility];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
